import { IParam, EntityBase } from "@/core";
import { IIBIZSupplier } from './interface/i-ibiz-supplier';
import IBIZSupplierKeys from './ibiz-supplier-keys';

/**
 * 供货商基类
 * 基于template/src/api/{{appEntities}}/{{appEntities}}-base.ts.hbs生成  
 *
 * @export
 * @abstract
 * @class IBIZSupplierBase
 * @extends { EntityBase }
 * @implements { IIBIZSupplier }
 */
export abstract class IBIZSupplierBase extends EntityBase implements IIBIZSupplier {
	/**
	 * 实体名称
	 *
	 * @readonly
	 * @type {string}
	 * @memberof IBIZSupplierBase
	 */
	get srfdename(): string {
		return 'IBIZSUPPLIER';
	}

	/**
     * 当前实体所有属性
     *
     * @protected
     * @type {string[]}
     * @memberof IBIZSupplierBase
     */
    protected get keys(): string[] {
        return IBIZSupplierKeys;
    }

	/**
	 * Creates an instance of ConstactOppoBase.
	 * @param {*} [data]
	 * @memberof IBIZSupplierBase
	 */
	constructor(data?: any) {
		super();
		this.setData(data);
	}

	/**
	 * 是否删除标记
	 **/
	deleteflag?: any;
	
	/**
	 * 创建人
	 **/
	createby?: any;
	
	/**
	 * 更新人
	 **/
	updateby?: any;
	
	/**
	 * 更新时间
	 **/
	updatetime?: any;
	
	/**
	 * 邮箱
	 **/
	email?: any;
	
	get srfmajortext(): string {
		return this.suppliername;
	}

	set srfmajortext(val: string) {
		this.suppliername = val;
	}
	/**
	 * 供应商名称
	 **/
	suppliername?: any;
	
	/**
	 * 创建时间
	 **/
	createtime?: any;
	
	/**
	 * 地址
	 **/
	address?: any;
	
	get srfkey(): string {
		return this.supplierid;
	}

	set srfkey(val: string) {
		this.supplierid = val;
	}

	/**
	 * 供应商标识
	 **/
	supplierid?: any;
	

	/**
	 * 重置实体数据
	 *
	 * @param {IParam} [data={}]
	 * @memberof IBIZSupplierBase
	 */
	reset(data: IParam = {}): void {
		super.reset(data);
		this.suppliername = data.suppliername || data.srfmajortext;
		this.supplierid = data.supplierid || data.srfkey;
	}
}